<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Doxygen: pcl::recognition::BVH&lt; UserData &gt; 模板类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Doxygen
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classpcl_1_1recognition_1_1_b_v_h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">类</a> &#124;
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pro-attribs">Protected 属性</a> &#124;
<a href="classpcl_1_1recognition_1_1_b_v_h-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">pcl::recognition::BVH&lt; UserData &gt; 模板类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p>This class is an implementation of bounding volume hierarchies. Use the build method to construct the data structure. To use the class, construct an std::vector of pointers to <a class="el" href="classpcl_1_1recognition_1_1_b_v_h_1_1_bounded_object.html">BVH::BoundedObject</a> objects and pass it to the build method. <a class="el" href="classpcl_1_1recognition_1_1_b_v_h_1_1_bounded_object.html">BVH::BoundedObject</a> is a template class, so you can save user-defined data in it.  
 <a href="classpcl_1_1recognition_1_1_b_v_h.html#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="ransac__based_2bvh_8h_source.html">bvh.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
类</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1recognition_1_1_b_v_h_1_1_bounded_object.html">BoundedObject</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1recognition_1_1_b_v_h_1_1_node.html">Node</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:af16d3d466445c2e2206bd709dabe8727"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1recognition_1_1_b_v_h.html#af16d3d466445c2e2206bd709dabe8727">build</a> (std::vector&lt; <a class="el" href="classpcl_1_1recognition_1_1_b_v_h_1_1_bounded_object.html">BoundedObject</a> * &gt; &amp;objects)</td></tr>
<tr class="memdesc:af16d3d466445c2e2206bd709dabe8727"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates the tree. No need to call clear, it's called within the method. 'objects' is a vector of pointers to bounded objects which have to have valid bounds and centroids. Use the getData method of <a class="el" href="classpcl_1_1recognition_1_1_b_v_h_1_1_bounded_object.html">BoundedObject</a> to retrieve the user-defined data saved in the object. Note that vector will be sorted within the method!  <a href="classpcl_1_1recognition_1_1_b_v_h.html#af16d3d466445c2e2206bd709dabe8727">更多...</a><br /></td></tr>
<tr class="separator:af16d3d466445c2e2206bd709dabe8727"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ac26c30f4bff3de64cba9f68ed7f035"><td class="memItemLeft" align="right" valign="top"><a id="a8ac26c30f4bff3de64cba9f68ed7f035"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1recognition_1_1_b_v_h.html#a8ac26c30f4bff3de64cba9f68ed7f035">clear</a> ()</td></tr>
<tr class="memdesc:a8ac26c30f4bff3de64cba9f68ed7f035"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees the memory allocated by this object. After that, you have to call build to use the tree again. <br /></td></tr>
<tr class="separator:a8ac26c30f4bff3de64cba9f68ed7f035"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0259a169e69c287447208066ae03e665"><td class="memItemLeft" align="right" valign="top"><a id="a0259a169e69c287447208066ae03e665"></a>
const std::vector&lt; <a class="el" href="classpcl_1_1recognition_1_1_b_v_h_1_1_bounded_object.html">BoundedObject</a> * &gt; *&#160;</td><td class="memItemRight" valign="bottom"><b>getInputObjects</b> () const</td></tr>
<tr class="separator:a0259a169e69c287447208066ae03e665"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acf13babff60c0b9fca8181a307dbb04e"><td class="memItemLeft" align="right" valign="top"><a id="acf13babff60c0b9fca8181a307dbb04e"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1recognition_1_1_b_v_h.html#acf13babff60c0b9fca8181a307dbb04e">intersect</a> (const float box[6], std::list&lt; <a class="el" href="classpcl_1_1recognition_1_1_b_v_h_1_1_bounded_object.html">BoundedObject</a> * &gt; &amp;intersected_objects) const</td></tr>
<tr class="memdesc:acf13babff60c0b9fca8181a307dbb04e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pushes back in 'intersected_objects' the bounded objects intersected by the input 'box' and returns true. Returns false if no objects are intersected. <br /></td></tr>
<tr class="separator:acf13babff60c0b9fca8181a307dbb04e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected 属性</h2></td></tr>
<tr class="memitem:a937c614502b89f017e208bb27d985d4a"><td class="memItemLeft" align="right" valign="top"><a id="a937c614502b89f017e208bb27d985d4a"></a>
<a class="el" href="classpcl_1_1recognition_1_1_b_v_h_1_1_node.html">Node</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>root_</b></td></tr>
<tr class="separator:a937c614502b89f017e208bb27d985d4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1c71261ae6285dc843200b827cb42b05"><td class="memItemLeft" align="right" valign="top"><a id="a1c71261ae6285dc843200b827cb42b05"></a>
std::vector&lt; <a class="el" href="classpcl_1_1recognition_1_1_b_v_h_1_1_bounded_object.html">BoundedObject</a> * &gt; *&#160;</td><td class="memItemRight" valign="bottom"><b>sorted_objects_</b></td></tr>
<tr class="separator:a1c71261ae6285dc843200b827cb42b05"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><h3>template&lt;class UserData&gt;<br />
class pcl::recognition::BVH&lt; UserData &gt;</h3>

<p>This class is an implementation of bounding volume hierarchies. Use the build method to construct the data structure. To use the class, construct an std::vector of pointers to <a class="el" href="classpcl_1_1recognition_1_1_b_v_h_1_1_bounded_object.html">BVH::BoundedObject</a> objects and pass it to the build method. <a class="el" href="classpcl_1_1recognition_1_1_b_v_h_1_1_bounded_object.html">BVH::BoundedObject</a> is a template class, so you can save user-defined data in it. </p>
<p>The tree is built such that each leaf contains exactly one object. </p>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="af16d3d466445c2e2206bd709dabe8727"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af16d3d466445c2e2206bd709dabe8727">&#9670;&nbsp;</a></span>build()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class UserData &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1recognition_1_1_b_v_h.html">pcl::recognition::BVH</a>&lt; UserData &gt;::build </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; <a class="el" href="classpcl_1_1recognition_1_1_b_v_h_1_1_bounded_object.html">BoundedObject</a> * &gt; &amp;&#160;</td>
          <td class="paramname"><em>objects</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Creates the tree. No need to call clear, it's called within the method. 'objects' is a vector of pointers to bounded objects which have to have valid bounds and centroids. Use the getData method of <a class="el" href="classpcl_1_1recognition_1_1_b_v_h_1_1_bounded_object.html">BoundedObject</a> to retrieve the user-defined data saved in the object. Note that vector will be sorted within the method! </p>
<p>The tree is built such that each leaf contains exactly one object. </p>
<div class="fragment"><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;        {</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;          this-&gt;<a class="code" href="classpcl_1_1recognition_1_1_b_v_h.html#a8ac26c30f4bff3de64cba9f68ed7f035">clear</a>();</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160; </div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;          <span class="keywordflow">if</span> ( objects.size () == 0 )</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160; </div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;          sorted_objects_ = &amp;objects;</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160; </div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;          <span class="comment">// Now sort the objects according to the x-coordinates of their centroids</span></div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;          std::sort (objects.begin (), objects.end (), <a class="code" href="classpcl_1_1recognition_1_1_b_v_h_1_1_bounded_object.html#a02fc019accc25a0caad7f1c1bbc1dc75">BoundedObject::compareCentroidsXCoordinates</a>);</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160; </div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;          <span class="comment">// Create the root -&gt; it recursively creates the children nodes until each leaf contains exactly one object</span></div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;          root_ = <span class="keyword">new</span> Node (objects, 0, <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span> (objects.size () - 1));</div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;        }</div>
<div class="ttc" id="aclasspcl_1_1recognition_1_1_b_v_h_1_1_bounded_object_html_a02fc019accc25a0caad7f1c1bbc1dc75"><div class="ttname"><a href="classpcl_1_1recognition_1_1_b_v_h_1_1_bounded_object.html#a02fc019accc25a0caad7f1c1bbc1dc75">pcl::recognition::BVH::BoundedObject::compareCentroidsXCoordinates</a></div><div class="ttdeci">static bool compareCentroidsXCoordinates(const BoundedObject *a, const BoundedObject *b)</div><div class="ttdoc">This method is for std::sort.</div><div class="ttdef"><b>Definition:</b> bvh.h:83</div></div>
<div class="ttc" id="aclasspcl_1_1recognition_1_1_b_v_h_html_a8ac26c30f4bff3de64cba9f68ed7f035"><div class="ttname"><a href="classpcl_1_1recognition_1_1_b_v_h.html#a8ac26c30f4bff3de64cba9f68ed7f035">pcl::recognition::BVH::clear</a></div><div class="ttdeci">void clear()</div><div class="ttdoc">Frees the memory allocated by this object. After that, you have to call build to use the tree again.</div><div class="ttdef"><b>Definition:</b> bvh.h:255</div></div>
</div><!-- fragment -->
</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>recognition/include/pcl/recognition/ransac_based/<a class="el" href="ransac__based_2bvh_8h_source.html">bvh.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>pcl</b></li><li class="navelem"><b>recognition</b></li><li class="navelem"><a class="el" href="classpcl_1_1recognition_1_1_b_v_h.html">BVH</a></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
